<template>
  <a-carousel autoplay class="com-web-home-banner" effect="fade">
    <div class="item" v-for="(v, k) in models" :key="k">
      <img class="bg-img" :src="v.pic" />
      <div class="show-box">
        <p class="title">
          {{ v.title }}
        </p>
        <p class="detail">
          {{ v.detail }}
        </p>
      </div>
    </div>
  </a-carousel>
</template>

<script lang="ts">
import { Vue, Component, Prop } from 'vue-property-decorator'
import Banner from '@/models/banner'

@Component({
  name: 'ComWebHomeBanner'
})
export default class ComWebHomeBanner extends Vue {
  @Prop({ default: () => [] }) models!: Array<Banner>
}
</script>

<style scoped lang="less">
.com-web-home-banner {
  .item {
    position: relative;
    width: 100%;
    height: 700px;
    .bg-img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
    .show-box {
      position: absolute;
      left: 0px;
      top: 0px;
    }
    .title {
      font-size: 20px;
      padding: 20px;
      color: #666;
    }
    .detail {
      font-size: 18px;
      padding: 18px;
      color: #999;
    }
  }
}
</style>
